﻿using Md.Api.Entity.DapperModels.MdDB;
using Md.Api.Model.Manage.MdBanner.Request;
using Md.Dapper.Repositories.Md;

namespace Md.Api.Service.Manage.MdBanner;
/// <summary>
/// 分页获取轮播图列表服务
/// </summary>
public class GetMdBannerPageListService : ApiBase<RequestGetMdBannerPageListModel>
{
    /// <summary>
    /// 轮播图仓储
    /// </summary>
    public MdBannerRep mdBannerRep { get; set; }
    /// <summary>
    /// 执行
    /// </summary>
    protected override void ExecuteMethod()
    {
        var model = new MdBannerModel();

        model.Title = Parameter.Title;
        model.Category = Parameter.Category;
        model.Status = Parameter.Status;
        model.CreateBy = Parameter.CreateBy;
        model.UpdateBy = Parameter.UpdateBy;

        var res = mdBannerRep.GetMdBannerPageList(model, Parameter.PageIndex, Parameter.PageSize, Parameter.OrderBy, Parameter.IsDesc);

        Result.Data = res;
    }
}
